<div id="container" style="width:90%; margin:0 auto;"></div>

<div id="container1" style="width:90%; margin:0 auto;"></div>


<div class="SipeiStat border_3 pb20 centered back_bgf mt20"><!--区外学校对比分析-统计-->
  <h1 class="clearfix pl20 mb20 fonts_18 height40 fontc_444 fontw_normal back_bgfd">总分分数段报表</h1>
  <form class="clearfix pt20 pr20 pb20 pl20">
    <table class="fontc_666 height32">
      <thead class="back_bgf5 fontc_999">
<tr>      
<th width="63" align="center" class="border_d">区域</th>
	<?php if(!empty($school_data)): ?>
      	<?php foreach ($school_data as $value): ?>
        
          <th width="63" align="center" class="border_d"><?php echo (!empty($value['school_name'])) ? $value['school_name'] : ''; ?></th>
        
         <?php endforeach;?>
         <?php endif;?> 

        </tr>
        
      </thead>
      <tbody class="fontc_444">
     
        <tr>
        <td align="center" class="border_d">人数</td>

         <?php if(!empty($school_data)): ?>
      	<?php foreach ($school_data as $value): ?>
          <td align="center" class="border_d"><?php echo $value['student_num']; ?></td>
        <?php endforeach;?>
         <?php endif;?> 
          </tr>
          
        <tr>
        <td align="center" class="border_d">最高分</td>

         <?php if(!empty($school_data)): ?>
      	<?php foreach ($school_data as $value): ?>
          <td align="center" class="border_d"><?php echo $value['max_score']?></td>
        <?php endforeach;?>
         <?php endif;?> 
          </tr>
          
          <?php if(!empty($point_array)): ?>
          	<?php foreach ($point_array as $pk=>$pv): ?>
          	<?php $xDatas[] = intval($pv['point']); ?>
          <tr>
        <td align="center" class="border_d"><?php echo $pv['point']; ?>以上</td>
	         <?php if(!empty($school_data)): ?>
	      	<?php foreach ($school_data as $sk=>$value): ?>
	      		<?php $temp[$sk]['data'][] = (!empty($value[$pk])) ? intval($value[$pk]) : '0'; ?>
	      		<?php $temp[$sk]['name'] = $value['school_name']; ?>
	          <td align="center" class="border_d"><?php echo (!empty($value[$pk])) ? $value[$pk] : '0'; ?></td>
	          
	        <?php endforeach;?>
	         <?php endif;?> 
          </tr>
          
          <?php endforeach;?>
         <?php endif;?>  
         
         <tr>
        <td align="center" class="border_d"><?php echo $point_down;?>以下</td>

         <?php if(!empty($school_data)): ?>
      	<?php foreach ($school_data as $value): ?>
          <td align="center" class="border_d"><?php echo ($value['student_num'] - $value['point_down_num']); ?></td>
        <?php endforeach;?>
         <?php endif;?> 
          </tr>
          
           <tr>
        <td align="center" class="border_d">达一本线</td>

         <?php if(!empty($school_data)): ?>
      	<?php foreach ($school_data as $k=>$value): ?>
      		<?php $temp1[$k]['data'][0] = (int)$value['student_num']; ?>
          <td align="center" class="border_d"><?php echo $value['student_num']; ?></td>
        <?php endforeach;?>
         <?php endif;?> 
          </tr>
          
           <tr>
        <td align="center" class="border_d">达二本人数</td>

         <?php if(!empty($school_data)): ?>
      	<?php foreach ($school_data as $k=>$value): ?>
		<?php $temp1[$k]['name'] = $value['school_name']; ?>
		<?php $temp1[$k]['data'][1] = (int)$value['student_num']; ?>
          <td align="center" class="border_d"><?php echo $value['student_num']; ?></td>
          
        <?php endforeach;?>
         <?php endif;?> 
          </tr>
          
          
          <?php 
          
          		$xData = json_encode($xDatas);
				$yData = json_encode($temp);
	

				$yData1 = json_encode($temp1);
				
          ?>
      </tbody>
    </table>
  </form>
</div>

<script type="text/javascript">
		
		function charts_line1( type,categories,data ){
			$('#container1').highcharts({
				title: {
					text: '成绩汇总',
					x: 0 //
				},
				subtitle: {
					text: type,
					x: 0
				},
				xAxis: {
					categories: categories
				},
				yAxis: {
					title: {
						text: ''
					},
					plotLines: [{
						value: 0,
						width: 1,
						color: '#808080'
					}]
				},
				tooltip: {
					valueSuffix: '人'
				},
				credits: {
					text: '',
					href: 'http://www.example.com'
				},
				series:data 
			});
			
		
		}


	function charts_line( type,categories,data ){
			$('#container').highcharts({
				title: {
					text: '成绩汇总',
					x: 0 //
				},
				subtitle: {
					text: type,
					x: 0
				},
				xAxis: {
					categories: categories
				},
				yAxis: {
					title: {
						text: ''
					},
					plotLines: [{
						value: 0,
						width: 1,
						color: '#808080'
					}]
				},
				tooltip: {
					valueSuffix: '人'
				},
				credits: {
					text: '',
					href: 'http://www.example.com'
				},
				series:data 
			});
			
		
		}
		
		
$(function () {
	var type = '（各等级分数及人数）',
	 	categories = <?php echo $xData; ?>,
     	 data = <?php echo $yData; ?>;

	charts_line( type,categories,data );
		    
});

$(function () {
	var type1 = '（达本分数线人数）',
	 	categories1 = <?php echo $xData1; ?>,
	 			data1 = <?php echo $yData1; ?>

	charts_line1( type1,categories1,data1 );
		    
});
</script>